#{extends 'organization.html' /} 
#{set title:'Confirm Filtered users'/}

#{if userCount == 0}
There are no users matching your query. Please check your input and try again. THANK YOU !
#{/if}
#{else}
<h1>Please select the users to which you would like to send invitations </h1>
<div class = "viewContent">
#{ifErrors}

<p class = "error">Oops</p>
   #{errors}
     <p class = "error" >${error}</p>
   #{/errors}
 
#{/ifErrors}
<div>
<label> Name of the user: &nbsp;&nbsp;&nbsp;&nbsp; </label>
<br>
<br>
</div>
<div>
#{if inviteToEntity == true}
#{list items:resultingUsers, as:'user'}
<p>
     <form action="@{UserController.sendInvitation()}" method="POST">
<input type="checkbox" name="ids" value='${user.id}' /> ${user.name}
#{/list}
<p>
<br>
<br>
<input type = submit value = ChooseUsers></input>
</p>
</form>
#{/if}
#{else}
#{list items:resultingUsers, as:'user'}
<p>
     <form action="@{UserController.sendInvitationToJoinOrganization()}" method="POST">
<input type="checkbox" name="ids" value='${user.id}' /> ${user.name}
#{/list}
<p>
<input type = submit value = Proceed></input>
</p>
</form>
#{/else}
</div>
#{/else}
<br>
<br>
<br>
<br>
<br>
<a href="@{Browse.viewEntity(entityIDToPass)}" class = "standardLink"><b>Back to Entity<b/></a>
</div>
